/* eslint-disable no-undef */

import {defineConfig} from "vite";
import vue from "@vitejs/plugin-vue";
import path from "path";

export default defineConfig({
  plugins: [vue()],
  resolve: {
    extensions: [".js", ".vue", ".json"],
    alias: {
      "@": path.resolve(__dirname, "./src"),
    },
  },
  // build: {
  //   minify: "terser",
  //   terserOptions: {
  //     compress: {
  //       drop_console: true,
  //       drop_debugger: true,
  //     }
  //   }
  // },
  base: "/dp/",
  server: {
    host: "0.0.0.0",
    hmr: true,
    proxy: {
      "/proxy": {
        // target: "http://xm.lcxxjs.cn/api/",
        // target: "http://ycjcs.lcxxjs.cn/",
        target: "http://192.168.100.17:8200/",
        changeOrigin: true,
        rewrite: (__) => __.replace(/^\/proxy/, ""),
      },
    },
  },
  css: {
    preprocessorOptions: {
      less: {
        javascriptEnabled: true,
      },
    },
  },
});
